# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=snac
pkgver=2.43
pkgrel=0
pkgdesc="Simple, minimalistic ActivityPub instance written in portable C"
url="https://codeberg.org/grunfink/snac2"
arch="all"
license="MIT"
makedepends="curl-dev openssl-dev"
install="$pkgname.pre-install"
pkgusers="snac"
pkggroups="snac"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/grunfink/snac2/archive/$pkgver.tar.gz
	snac.initd
	"
builddir="$srcdir/snac2"
options="!check" # no test suite

build() {
	make
}

package() {
	make install \
		PREFIX="$pkgdir"/usr \
		PREFIX_MAN="$pkgdir"/usr/share/man

	install -dm750 -o snac -g snac "$pkgdir"/var/lib/snac

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/

	install -Dm755 "$srcdir"/snac.initd "$pkgdir"/etc/init.d/snac
}

sha512sums="
8daa1e60029826274b796851e2ba44441fa9a74a2f38b4c99d14f607f897c7c7031b3a190330cda1ec78eba68b5fa5f07db8ed374072fb254468ce35f298086d  snac-2.43.tar.gz
8451eb37e5135b926a1a36b7f69d63cb76aa617ca3f9b9167f2284223582dcf66723ee67c51c6abc2d1605c41678d26f67ec6cb1bf920c61379dbf63f7852e1a  snac.initd
"
